package chap_04_JOL;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

/**
 * @Description java object layout：java对象布局
 * @Author shihan
 * @Date 2022/11/6 12:15
 * @Version 1.0
 */
public class JOL_demo_01 {

    public static void main(String[] args) {
        System.out.println(VM.current().details());

        System.out.println();

        System.out.println(ClassLayout.parseInstance(new MyCustomer()).toPrintable());
    }

}

class MyCustomer {
    // 4字节
    int age;
    // 4字节
    String name;
    // 1字节
    boolean flag;
}
